package com.fyzk.manager;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import java.net.URISyntaxException;

/**
 * Created by Administrator on 2018/9/26.
 */

public class UIManager {
    public static void startActivityByUri(Context activity, String uri) {
        startActivityByUri(activity, uri, null);
    }

    public static void startActivityByUri(Context activity, String uri, Bundle bundle) {
        if (null == activity || null == uri || 0 >= uri.trim().length()) {
            return;
        }
        Intent intent = null;
        try {
            intent = Intent.parseUri(uri, 0);
            if (null != bundle)
                intent.putExtras(bundle);
            activity.startActivity(intent);
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
    }
}
